<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智慧Agent平台</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');

        body {
            font-family: 'Noto Sans SC', sans-serif;
            background: linear-gradient(135deg, #f0f9ff 0%, #e6f4ff 100%);
        }

        .card-hover {
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        .card-hover:hover {
            transform: translateY(-8px);
            box-shadow: 0 15px 30px rgba(0, 105, 204, 0.1);
            border-color: rgba(59, 130, 246, 0.2);
        }

        .app-icon {
            width: 56px;
            height: 56px;
            border-radius: 16px;
            transition: all 0.3s ease;
        }

        .hero-text {
            background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .wave-bg {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            overflow: hidden;
            line-height: 0;
        }

        .wave-bg svg {
            position: relative;
            display: block;
            width: calc(100% + 1.3px);
            height: 150px;
        }

        .wave-bg .shape-fill {
            fill: #FFFFFF;
        }
    </style>
</head>
<body class="min-h-screen">
    <header class="bg-white/80 backdrop-blur-sm shadow-sm sticky top-0 z-50">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-8">
                <div class="flex items-center space-x-3">
                    <div class="w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center">
                        <svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"></path>
                        </svg>
                    </div>
                    <h1 class="text-2xl font-bold text-blue-600">智慧Agent平台</h1>
                </div>
            </div>
            <div id="auth-buttons" class="flex items-center space-x-4">
                <!-- 动态内容由JavaScript填充 -->
            </div>
        </div>
    </header>

    <main class="container mx-auto px-4 py-8 relative">
        <section class="text-center mb-8 mt-4">
            <h2 class="text-3xl md:text-4xl font-bold hero-text mb-2 leading-tight">智慧Agent平台</h2>
            <p class="text-base text-gray-700 mb-4 max-w-2xl mx-auto">探索人工智能的无限可能，让智能服务助力您的工作</p>

            <div class="mt-6 max-w-4xl mx-auto">
                <lottie-player src="https://assets3.lottiefiles.com/packages/lf20_5tkzkblw.json"
                              background="transparent"
                              speed="1"
                              style="width: 100%; height: 200px;"
                              loop
                              autoplay></lottie-player>
            </div>
        </section>

        <section class="mb-16">
            <div class="flex justify-between items-center mb-8">
                <div>
                    <h3 class="text-2xl font-semibold text-gray-800">推荐应用</h3>
                    <p class="text-gray-500 mt-1">精选智能服务，提升工作效率</p>
                </div>
                <button class="text-blue-600 hover:text-blue-800 flex items-center group">
                    <span>换一换</span>
                    <svg class="w-5 h-5 ml-1 group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3"></path>
                    </svg>
                </button>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
                <!-- Application Card 1 -->
                <div class="bg-white rounded-2xl shadow-md p-6 transition-all duration-300 card-hover flex flex-col">
                    <div class="flex items-start mb-4">
                        <div class="app-icon bg-blue-100 flex items-center justify-center mr-4 group-hover:bg-blue-200">
                            <svg class="w-7 h-7 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"></path>
                            </svg>
                        </div>
                        <div>
                            <h4 class="text-lg font-semibold mb-1">大语言模型</h4>
                            <p class="text-sm text-gray-500">DeepSeek</p>
                        </div>
                    </div>
                    <p class="text-gray-600 text-sm mb-6">纯智语模型，AI智能助手，智能对话，智能问答</p>
                    <div class="mt-auto flex space-x-3">
                        <a href="/chat?model=deepseek&mode=standard" class="flex-1 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-all text-center">
                            立即使用
                        </a>
                        <button class="w-10 h-10 flex items-center justify-center bg-blue-50 text-blue-600 rounded-lg hover:bg-blue-100 transition-all">
                            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                            </svg>
                        </button>
                    </div>
                </div>

                <!-- Application Card 2 -->
                <div class="bg-white rounded-2xl shadow-md p-6 transition-all duration-300 card-hover flex flex-col">
                    <div class="flex items-start mb-4">
                        <div class="app-icon bg-purple-100 flex items-center justify-center mr-4 group-hover:bg-purple-200">
                            <svg class="w-7 h-7 text-purple-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"></path>
                            </svg>
                        </div>
                        <div>
                            <h4 class="text-lg font-semibold mb-1">工作流Agent</h4>
                            <p class="text-sm text-gray-500">DeepSeek+Agent</p>
                        </div>
                    </div>
                    <p class="text-gray-600 text-sm mb-6">该模式的应用会严格按照人工编排的工作流进行对话，适用于严谨的业务流程</p>
                    <div class="mt-auto flex space-x-3">
                        <button class="flex-1 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-all">
                            立即使用
                        </button>
                        <button class="w-10 h-10 flex items-center justify-center bg-blue-50 text-blue-600 rounded-lg hover:bg-blue-100 transition-all">
                            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                            </svg>
                        </button>
                    </div>
                </div>

                <!-- Application Card 3 -->
                <div class="bg-white rounded-2xl shadow-md p-6 transition-all duration-300 card-hover flex flex-col">
                    <div class="flex items-start mb-4">
                        <div class="app-icon bg-green-100 flex items-center justify-center mr-4 group-hover:bg-green-200">
                            <svg class="w-7 h-7 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path>
                            </svg>
                        </div>
                        <div>
                            <h4 class="text-lg font-semibold mb-1">自主规划Agent</h4>
                            <p class="text-sm text-gray-500">DeepSeek+Agent</p>
                        </div>
                    </div>
                    <p class="text-gray-600 text-sm mb-6">该模式的应用会自主思考并规划任务，适用于基础或日常的业务流程</p>
                    <div class="mt-auto flex space-x-3">
                        <button class="flex-1 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-all">
                            立即使用
                        </button>
                        <button class="w-10 h-10 flex items-center justify-center bg-blue-50 text-blue-600 rounded-lg hover:bg-blue-100 transition-all">
                            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                            </svg>
                        </button>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <footer class="bg-white py-8">
        <div class="container mx-auto px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-6 md:mb-0">
                    <div class="flex items-center space-x-3">
                        <div class="w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center">
                            <svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"></path>
                            </svg>
                        </div>
                        <span class="text-xl font-bold text-blue-600">智慧Agent平台</span>
                    </div>
                    <p class="text-gray-500 mt-2 text-sm">让智能服务改变生活</p>
                </div>

                <div class="flex flex-col space-y-2 text-sm text-gray-600">
                    <div class="flex items-center">
                        <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path>
                        </svg>
                        <span>邮箱: forzenzhencola@163.com</span>
                    </div>
                    <div class="flex items-center">
                        <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"></path>
                        </svg>
                        <span>电话: 15191913497</span>
                    </div>
                    <div class="flex items-center">
                        <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path>
                        </svg>
                        <span>联系人: 王震</span>
                    </div>
                </div>
            </div>

            <div class="border-t border-gray-200 mt-8 pt-8 text-center text-gray-500 text-sm">
                <p>© 2025 王震. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script>
        // 检查用户登录状态
        document.addEventListener('DOMContentLoaded', function() {
            checkAuthStatus();
        });

        function checkAuthStatus() {
            const token = localStorage.getItem('access_token');
            const authButtons = document.getElementById('auth-buttons');

            if (token) {
                // 用户已登录
                try {
                    const userData = JSON.parse(localStorage.getItem('user_data'));
                    authButtons.innerHTML = `
                        <span class="text-gray-700">欢迎, ${userData.username}</span>
                        <a href="/admin" class="bg-gradient-to-r from-blue-600 to-blue-500 text-white px-6 py-2 rounded-lg hover:from-blue-700 hover:to-blue-600 transition-all shadow-md hover:shadow-lg">
                            管理后台
                        </a>
                        <button onclick="logout()" class="bg-gradient-to-r from-blue-600 to-blue-500 text-white px-6 py-2 rounded-lg hover:from-blue-700 hover:to-blue-600 transition-all shadow-md hover:shadow-lg">
                            退出登录
                        </button>
                    `;
                } catch (e) {
                    console.error('Error parsing user data:', e);
                    authButtons.innerHTML = `
                        <a href="/login" class="bg-gradient-to-r from-blue-600 to-blue-500 text-white px-6 py-2 rounded-lg hover:from-blue-700 hover:to-blue-600 transition-all shadow-md hover:shadow-lg">
                            点我登录
                        </a>
                    `;
                }
            } else {
                // 用户未登录
                authButtons.innerHTML = `
                    <a href="/login" class="bg-gradient-to-r from-blue-600 to-blue-500 text-white px-6 py-2 rounded-lg hover:from-blue-700 hover:to-blue-600 transition-all shadow-md hover:shadow-lg">
                        点我登录
                    </a>
                `;
            }
        }

        async function logout() {
            try {
                const response = await fetch('/api/logout', {
                    method: 'POST',
                    headers: {
                        'Authorization': `Bearer ${localStorage.getItem('access_token')}`,
                        'Content-Type': 'application/json'
                    }
                });

                if (response.ok) {
                    localStorage.removeItem('access_token');
                    localStorage.removeItem('user_data');
                    window.location.href = '/login';
                } else {
                    const data = await response.json();
                    alert(data.error || '退出登录失败');
                }
            } catch (error) {
                console.error('退出登录错误:', error);
                alert('网络错误，请稍后重试');
            }
        }
    </script>
</body>
</html>